//
//  HWSpaceCell.m
//  HuaWan
//
//  Created by HuaWan on 2022.
//  Copyright © 2022 HuaWan. All rights reserved.
//

#import "HWSpaceCell.h"

@implementation HWSpaceCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setData:(id)data delegate:(id)delegate {
    
    if ([data isKindOfClass:[NSDictionary class]]) {
        if ([data[@"data"] isKindOfClass:[HWSpaceCellModel class]]) {
            HWSpaceCellModel *model = data[@"data"];
            if (model.bagroundColor) {
                self.contentView.backgroundColor = model.bagroundColor;
            } else {
                self.contentView.backgroundColor = [UIColor clearColor];
            }
        }
    }
}

@end


#pragma mark - Model

@implementation HWSpaceCellModel

+ (HWSpaceCellModel *)ittemModelWithBagroundColor:(UIColor *)bagroundColor {
    HWSpaceCellModel *model = [HWSpaceCellModel new];
    model.bagroundColor = bagroundColor;
    return model;
}

@end
